cmake_minimum_required (VERSION 2.6)
project ("Distribuidos")

set(SRC_DIR src/)
set(OUT_DIR_BASE out/)
set(OUT_DIR_PRACTICAS "${OUT_DIR_BASE}practicas/")
set(OUT_DIR "${OUT_DIR_PRACTICAS}amantaut/")
set(CMAKE_BUILD_TYPE Debug)
include_directories("${SRC_DIR}")
include_directories("${SRC_DIR}IPC")
include_directories("${SRC_DIR}common")

AUX_SOURCE_DIRECTORY ("${SRC_DIR}common" COMMON_SRC)
AUX_SOURCE_DIRECTORY ("${SRC_DIR}IPC" COMMON_SRC)
AUX_SOURCE_DIRECTORY ("${SRC_DIR}logger" COMMON_SRC)
AUX_SOURCE_DIRECTORY ("${SRC_DIR}practicas/amantaut/ej1/Middleware" EJ1_COMMON_SRC)
AUX_SOURCE_DIRECTORY ("${SRC_DIR}practicas/amantaut/ej2/Middleware" EJ2_COMMON_SRC)
file(MAKE_DIRECTORY ${OUT_DIR_BASE})
file(MAKE_DIRECTORY ${OUT_DIR_PRACTICAS})
file(MAKE_DIRECTORY ${OUT_DIR})
file(MAKE_DIRECTORY ${OUT_DIR}ej1)
file(MAKE_DIRECTORY ${OUT_DIR}ej2)
file(MAKE_DIRECTORY ${OUT_DIR}ej4)
file(MAKE_DIRECTORY ${OUT_DIR}ej5)
file(MAKE_DIRECTORY ${OUT_DIR}ej8)
file(MAKE_DIRECTORY ${OUT_DIR}zoo)

add_executable(${OUT_DIR}ej1/launcher ${SRC_DIR}practicas/amantaut/ej1/launcher.cpp ${SRC_DIR}practicas/amantaut/ej1/Puerta.cpp ${COMMON_SRC} ${EJ1_COMMON_SRC})
add_executable(${OUT_DIR}ej1/persona ${SRC_DIR}practicas/amantaut/ej1/persona.cpp ${SRC_DIR}practicas/amantaut/ej1/Puerta.cpp ${COMMON_SRC} ${EJ1_COMMON_SRC})
add_executable(${OUT_DIR}ej1/persona2 ${SRC_DIR}practicas/amantaut/ej1/persona2.cpp ${SRC_DIR}practicas/amantaut/ej1/Puerta.cpp ${COMMON_SRC} ${EJ1_COMMON_SRC})
add_executable(${OUT_DIR}ej1/puerta ${SRC_DIR}practicas/amantaut/ej1/puerta.cpp ${SRC_DIR}practicas/amantaut/ej1/Puerta.cpp ${COMMON_SRC} ${EJ1_COMMON_SRC})
add_executable(${OUT_DIR}ej1/terminator ${SRC_DIR}practicas/amantaut/ej1/terminator.cpp ${SRC_DIR}practicas/amantaut/ej1/Puerta.cpp ${COMMON_SRC} ${EJ1_COMMON_SRC})

add_executable(${OUT_DIR}ej2/launcher ${SRC_DIR}practicas/amantaut/ej2/launcher.cpp ${SRC_DIR}practicas/amantaut/ej2/Puerta.cpp ${COMMON_SRC} ${EJ2_COMMON_SRC})
add_executable(${OUT_DIR}ej2/persona ${SRC_DIR}practicas/amantaut/ej2/persona.cpp ${SRC_DIR}practicas/amantaut/ej2/Puerta.cpp ${COMMON_SRC} ${EJ2_COMMON_SRC})
add_executable(${OUT_DIR}ej2/persona2 ${SRC_DIR}practicas/amantaut/ej2/persona2.cpp ${SRC_DIR}practicas/amantaut/ej2/Puerta.cpp ${COMMON_SRC} ${EJ2_COMMON_SRC})
add_executable(${OUT_DIR}ej2/puerta ${SRC_DIR}practicas/amantaut/ej2/puerta.cpp ${SRC_DIR}practicas/amantaut/ej2/Puerta.cpp ${COMMON_SRC} ${EJ2_COMMON_SRC})
add_executable(${OUT_DIR}ej2/terminator ${SRC_DIR}practicas/amantaut/ej2/terminator.cpp ${SRC_DIR}practicas/amantaut/ej2/Puerta.cpp ${COMMON_SRC} ${EJ2_COMMON_SRC})

add_executable(${OUT_DIR}ej4/launcher ${SRC_DIR}practicas/amantaut/ej4/launcher.cpp ${COMMON_SRC})
add_executable(${OUT_DIR}ej4/producer ${SRC_DIR}practicas/amantaut/ej4/producer.cpp ${COMMON_SRC})
add_executable(${OUT_DIR}ej4/consumer ${SRC_DIR}practicas/amantaut/ej4/consumer.cpp ${COMMON_SRC})
add_executable(${OUT_DIR}ej4/terminator ${SRC_DIR}practicas/amantaut/ej4/terminator.cpp ${COMMON_SRC})
add_executable(${OUT_DIR}ej5/launcher ${SRC_DIR}practicas/amantaut/ej5/launcher.cpp ${COMMON_SRC} ${SRC_DIR}practicas/amantaut/ej5/WaitRoomApi.cpp)
add_executable(${OUT_DIR}ej5/terminator ${SRC_DIR}practicas/amantaut/ej5/terminator.cpp ${COMMON_SRC} ${SRC_DIR}practicas/amantaut/ej5/WaitRoomApi.cpp)
add_executable(${OUT_DIR}ej5/producer ${SRC_DIR}practicas/amantaut/ej5/producer.cpp ${COMMON_SRC} ${SRC_DIR}practicas/amantaut/ej5/WaitRoomApi.cpp)
add_executable(${OUT_DIR}ej5/bus ${SRC_DIR}practicas/amantaut/ej5/bus.cpp ${COMMON_SRC} ${SRC_DIR}practicas/amantaut/ej5/WaitRoomApi.cpp)
add_executable(${OUT_DIR}ej8/launcher ${SRC_DIR}practicas/amantaut/ej8/launcher.cpp ${COMMON_SRC} ${SRC_DIR}practicas/amantaut/ej8/Sequencer.cpp)
add_executable(${OUT_DIR}ej8/terminator ${SRC_DIR}practicas/amantaut/ej8/terminator.cpp ${COMMON_SRC} ${SRC_DIR}practicas/amantaut/ej8/Sequencer.cpp)
add_executable(${OUT_DIR}ej8/processer ${SRC_DIR}practicas/amantaut/ej8/processer.cpp ${COMMON_SRC} ${SRC_DIR}practicas/amantaut/ej8/Sequencer.cpp)


#add_executable(${OUT_DIR}zoo/puerta   ${SRC_DIR}TP\ Zoologico/Entrada/puerta.cpp ${COMMON_SRC})
#add_executable(${OUT_DIR}zoo/sala_bus ${SRC_DIR}TP\ Zoologico/Entrada/salaBus.cpp ${COMMON_SRC})
#add_executable(${OUT_DIR}zoo/persona ${SRC_DIR}TP\ Zoologico/Entrada/persona.cpp ${COMMON_SRC})
#add_executable(${OUT_DIR}zoo/persona2 ${SRC_DIR}TP\ Zoologico/Entrada/persona2.cpp ${COMMON_SRC})
#add_executable(${OUT_DIR}zoo/bus ${SRC_DIR}TP\ Zoologico/Entrada/bus.cpp ${COMMON_SRC})
#add_executable(${OUT_DIR}zoo/terminator ${SRC_DIR}TP\ Zoologico/Entrada/terminator.cpp ${COMMON_SRC})
#add_executable(${OUT_DIR}zoo/launcher ${SRC_DIR}TP\ Zoologico/Entrada/launcher.cpp ${COMMON_SRC})

